﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CaiyinSoft.NetGather.NetGather
{
    class Utility
    {

        public static string OpenInputMessageBox(string prompt )
        {
            bool checkBoxChecked = false;
            return OpenInputMessageBox(prompt, "","",out  checkBoxChecked );
        }
        public static string OpenInputMessageBox(string prompt, string defaultValue)
        {
            bool checkBoxChecked = false;
            return OpenInputMessageBox(prompt, defaultValue, "", out  checkBoxChecked);
        }
        public static string OpenInputMessageBox(string prompt, string defaultValue, string checkBoxText,out bool checkBoxChecked )
        {
            checkBoxChecked = false;
            FrmInputMessageBox box = new FrmInputMessageBox();
            box.Prompt = prompt;
            box.DefaultValue = defaultValue;
            if (checkBoxText.Trim().Length > 0)
            {
                box.ShowCheckBox = true;
                box.CheckBoxText = checkBoxText;
            }
            DialogResult res = box.ShowDialog();
            if (res != DialogResult.OK)
            {
                return string.Empty;
            }
            else
            {
                checkBoxChecked = box.CheckBoxChecked;
                return box.InputValue;
            }
        }
    }
}
